import React from 'react'

const messages = [
    {
        id: 1,
        title: 'msg1'
    },
    {
        id: 2,
        title: 'msg2'
    },
    {
        id: 3,
        title: 'msg3'
    },
    {
        id: 4,
        title: 'msg4'
    }
]
export default function MessageDetail(props) {
    const {id} = props.match.params
    const msg = messages.find((item)=>item.id === id*1)
    return (
        <ul>
            <li>ID:{id}</li>
            <li>Title:{msg.title}</li>
        </ul>
    )
}
